The larger of a and b.
max(a, b) -> real| Name | Type |
|---|---|
a | real |
b | real |
real
The larger of a and b.
Given two whole numbers, max hands back a whole number; if either one is a decimal, the answer is a decimal. max_int does the same for whole numbers but refuses a decimal outright.
hsp = max(hsp - 1, -3);Accelerates this object leftward by 1 every frame, but never past a top speed of 3 the other way - once hsp - 1 would go lower than -3, max keeps handing back -3 instead. min's own example caps the opposite direction; together they are a top speed on both sides. clamp does both at once against two fixed bounds in one call.
One comparison - as cheap as this group gets, safe to call every frame.
min’s own twin (the GBA module’s own max) - one comparison. When both numbers are whole numbers the answer is a whole number too; if either is a decimal the answer is a decimal. max_int is the same call, for when you want a decimal refused outright.